<?php

	$id = $_GET['id'];

	$re = selectAll('pro_cate',"pid=$id");
	//print_r($re) ;
	//die;
	if(!empty($re))
	{
		echo '不允许删除有子集的分类';
		header('Refresh:1;index.php?a=admin&b=pro_cate&c=index');
		die;	
	}else
	{
		$result = delete('pro_cate', $id);
		if($result>=0)
		{
			echo '删除成功';
			header('Refresh:1;index.php?a=admin&b=pro_cate&c=index');
			die;
		}else
		{
			echo '删除失败';
			header('Refresh:1;index.php?a=admin&b=pro_cate&c=index');
			die;	
		}
	}
	


	
?>